<template>
  <div>
    <button @click="getData1">点我获取分类数据</button>
    <button @click="getData2">点我获取头条数据</button>
  </div>
</template>

<script>
  import axios from 'axios'
  export default {
    name:'App',
    methods: {
      getData1(){
        axios.get('http://sph-h5-api.atguigu.cn/api/product/getBaseCategoryList').then(
          (response)=>{
            console.log('成功',response.data)
          },
          (error)=>{
            console.log('失败',error)
          }
        )
      },
      getData2(){
        axios.get('http://localhost:8080/hot-event/hot-board/?origin=toutiao_pc').then(
          (response)=>{
            console.log('成功',response.data)
          },
          (error)=>{
            console.log('失败',error)
          }
        )
      }
    },
  }
</script>
